package com.ler.yrmall.member.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ler.yrmall.member.entity.GrowthChangeHistoryEntity;
import com.ler.yrmall.member.mapper.GrowthChangeHistoryMapper;
import com.ler.yrmall.member.service.GrowthChangeHistoryService;
import com.ler.yrmall.utils.SecurityUtils;
import org.springframework.stereotype.Service;

/**
 * @author leron
 */
@Service
public class GrowthChangeHistoryServiceImpl extends ServiceImpl<GrowthChangeHistoryMapper, GrowthChangeHistoryEntity> implements GrowthChangeHistoryService {

    @Override
    public void checkin() {
        GrowthChangeHistoryEntity growthChangeHistory = new GrowthChangeHistoryEntity();
        growthChangeHistory.setChangeCount(GrowthChangeHistoryEntity.DataSource.CHECKIN.getScore());
        growthChangeHistory.setDataSource(GrowthChangeHistoryEntity.DataSource.CHECKIN.getCode());
        growthChangeHistory.setRemark(GrowthChangeHistoryEntity.DataSource.CHECKIN.getRemark());
        growthChangeHistory.setMemberId(SecurityUtils.getLoginUser().getId());
        growthChangeHistory.insert();
    }

}